package com.xhkj.componet;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
 
public class MyESClient {
	private static RestHighLevelClient client = null;
	public static RestHighLevelClient getClient() throws Exception
	{
		if(client == null)
		{	
			//78/79
			client = new RestHighLevelClient(RestClient.builder(new HttpHost("20.204.16.78", 9200, "http"), new HttpHost("20.204.16.79", 9200, "http")));
			return client;
		}
		else
		{
			return client;
		}
	}
}
